home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / BSDPSX / MKNOD.C < prev    next >
C/C++ Source or Header  |  1992-10-25  |  389b  |  21 lines

  1. /*
  2.  * MKNOD: DF_MSS
  3.  */
  4.  
  5. #include <sys/types.h>
  6. #include <sys/stat.h>
  7. #include <unistd.h>
  8.  
  9. int mknod (const char *path, mode_t mode, int dev)
  10. {
  11.     int ret;
  12.  
  13.     if ((mode & S_IFMT) == S_IFDIR)
  14.         ret = mkdir(path, (mode & S_IFMT));
  15.     else if ((mode & S_IFMT) == S_IFIFO)
  16.         ret = mkfifo(path, (mode & S_IFMT));
  17.     else
  18.         ret = -1;
  19.     return ret;
  20. }
  21.